<%--
  Created by IntelliJ IDEA.
  User: 77869
  Date: 2022/11/15
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品信息查询</title>
    <%@ include file="header.jsp" %>
</head>
<body>

<a class="btn btn-primary" href="${path}/shops_add.jsp">添加</a>
<table class="table table-striped table-bordered  table-hover">
    <tr>
        <td>商店ID</td>
        <td>商店名</td>
        <td>商店地址</td>
        <td>修改</td>
        <td>删除</td>
    </tr>
    <c:forEach items="${shop_list}" var="shop">
        <tr>
            <td>${shop.shop_id}</td>

            <td>${shop.shop_name}</td>
            <td>${shop.shop_loc}</td>
            <td><a href="${path}/shops?method=selectById&shop_id=${shop.shop_id}">修改</a></td>
            <td><a href="javascript:delectById(${shop.shop_id})">删除</a></td>
        </tr>
    </c:forEach>

</table>

<script>
    function delectById(id) {
        layer.confirm("您确定要删除吗？", function () {
            location.href = ("${path}/shops?method=deleteById&shop_id=" + id)
        })
    }
</script>
</body>
</html>
